/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.router.core.domain.service.receipt.action;


import cn.hutool.core.bean.BeanUtil;
import info.peigen.hotpot.business.router.core.repository.entity.ReceiptCardEntity;
import info.peigen.hotpot.business.router.facade.result.virtualaccount.info.VirtualAccountInfo;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <b>(VirtualAccountConvertor)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/1/11
 */
public class VirtualAccountConvertor {
    public static VirtualAccountInfo convert(ReceiptCardEntity entity) {
        return BeanUtil.copyProperties(entity, VirtualAccountInfo.class);
    }

    public static List<VirtualAccountInfo> convert(List<ReceiptCardEntity> entities) {
        return entities.stream().map(entity -> BeanUtil.copyProperties(entity, VirtualAccountInfo.class)).collect(Collectors.toList());
    }
}
